<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>添加带时间的文本框</title>
</head>

<body>
  <button onclick="addTimeTextBox()">添加带时间的文本框</button>
  <script>
    function addTimeTextBox() {
      var now = new Date();
      var options = { hour: 'numeric', minute: 'numeric', second: 'numeric' };
      var time = now.toLocaleTimeString('zh-CN', options);
      var textBox = document.createElement('input');
      textBox.type = 'text';
      textBox.value = time;
      document.body.appendChild(textBox);
    }
  </script>
</body>

</html>